package jwcb.admin.api.config.frign;

import jakarta.validation.constraints.NotBlank;
import jwcb.admin.api.config.domain.dto.ArgumentDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@Validated
@FeignClient(contextId="argumentFeignClient",value="jwcb-admin")
public interface ArgumentFeignClient {
    /**
     * 根据参数键查询参数对象
     * @param configKey 参数键
     * @return 参数对象
     */
    @GetMapping("/argument/key")
    ArgumentDTO getByConfigKey(@NotBlank(message = "参数键不能为空")@RequestParam String configKey);

    /**
     * 根据多个参数键查询多个参数对象
     * @param configKeys 多个参数键
     * @return 多个参数对象
     */
    @GetMapping("/argument/keys")
    List<ArgumentDTO> getByConfigKeys(@RequestBody List<String> configKeys);
}
